package initialize

import (
	"portal_api/global"
	"portal_api/rabbitmq"

	"go.uber.org/zap"
)

func InitRabbitMQ(isDebug bool) {
	global.Producer = rabbitmq.NewRabbitMQTopicProducer(&rabbitmq.RabbitOptions{
		QueueName:    global.ServerConfig.TxQueue.Queue,
		ExchangeName: global.ServerConfig.TxQueue.Exchange,
		BindingKey:   global.ServerConfig.TxQueue.BindingKey,
		Username:     global.ServerConfig.RabbitMQ.Username,
		Password:     global.ServerConfig.RabbitMQ.Password,
		Host:         global.ServerConfig.RabbitMQ.Host,
		Port:         global.ServerConfig.RabbitMQ.Port,
	})
	zap.L().Info("rabbitmq initialized")
}
